#define _CRT_SECURE_NO_WARNINGS
#include"stack.h"
#include"queue.h"
void STtest()
{
	STNode st;
	STInit(&st);
	STPush(&st, 1);
	STPush(&st, 2);
	STPush(&st, 3);
	STPush(&st, 4);

	printf("size = %d\n", STSize(&st));

	while (!STEmpty(&st))
	{
		STDatatype data = STTop(&st);
		printf("%d ", data);
		STPop(&st);
	}

	printf("\nsize = %d\n", STSize(&st));

	STDestroy(&st);
}
void QueueTest()
{
	Queue q;
	QueueInit(&q);
	QueuePush(&q, 1);
	QueuePush(&q, 2);
	QueuePush(&q, 3);
	QueuePush(&q, 4);

	printf("head:%d\n", QueueFront(&q));
	printf("tail:%d\n", QueueBack(&q));
	printf("size:%d\n", QueueSize(&q));

	QueuePop(&q);

	printf("head:%d\n", QueueFront(&q));
	printf("tail:%d\n", QueueBack(&q));
	printf("size:%d\n", QueueSize(&q));

	QueueDestory(&q);
}
int main()
{
	/*STtest();*/
	QueueTest();
	return 0;
}